package com.menghanjun.mhjresourcesharing.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 响应枚举类
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum JsonResponseStatus {
    SUCCESS(200,"OK"),
    ERORR(500,"内部错误！"),
    MOBILE_OR_PWD_NULL(100101,"用户名或者密码不能为空！"),
    TOKEN_ENPTY(1001012,"此账号已到期！"),
    PWD_ERORR(100103,"密码错误"),
    USER_NULL(100104,"用户不存在"),
    OPERATION_FAILED(100106,"操作失败"),
    LACK_PARAM(100108,"缺少必要的参数！"),
    CHAT_ERR(100109,"遇到了一些问题，请刷新后重试!"),
    CHAT_TEXT_LONG(1001011,"你输入的文本过长，请减少字数!"),
    NOT_ADMIN(1001013,"请登录管理员账号！"),
    USER_EXIST(1001014,"用户已存在！"),
    SEND_CODE_ERROR(1001015,"发送验证码失败！"),
    REPEAT_GET_CODE(1001016,"重复发送验证码！"),
    CODE_ERRER(1001017,"验证码错误！"),
    CODE_NULL(1001018,"验证码已过期！"),
    AUTHORITY_NOT(1001019,"此功能需要高级用户权限！"),
    VIP_NOT(1001020,"GPT4需要会员用户权限！"),
    PRIVATE_MSG_CANCEL(100107,"用户取消回复"),
    FILE_TYPE_ERROR(1001021, "非法的文件类型！");


    private int code;
    private String msg;

    public  static JsonResponseStatus getvalue(String code){
        JsonResponseStatus result = null;
        for (JsonResponseStatus status : JsonResponseStatus.values()) {
            if(code.equals(status.getCode()+"")){
                result = status;
            }
        }
        return result;
    }

}
